package com.data.common.crm.api;

import com.data.common.api.vo.CrmResult;
import com.data.common.crm.entity.AdminDeptVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @Description
 * @Date 2022/1/10 11:38
 * @Author funing
 */
@FeignClient(url = "${crm.admin-url:}",name = "admin",contextId = "adminDept")
public interface AdminDeptService {
    @PostMapping(value = "/adminDept/queryAllSite")
    CrmResult<List<AdminDeptVo>> queryAllSite();
    /**
     * 根据站点id获取主体名称和站点名称
    * */
    @PostMapping({"/adminDept/queryDeptInfoByDeptId"})
    CrmResult<AdminDeptVo> queryDeptInfoByDeptId(@RequestParam("deptId") Integer deptId);


    /**
     * 根据主体名称获取主体子集集合
     *
     * @param deptNames
     * @return
     */
    @PostMapping("/adminDept/findDeptVoList/querySubjectByNames")
    CrmResult<Map<String,List<AdminDeptVo>>> querySubjectByNames(@RequestParam(value = "deptNames", required = false) String deptNames);

}
